package com.wwj.Constant;

/**
 * 常量类，充当配置文件的作用
 */
public class Constant {
    //final修饰类不能被继承
    //修饰方法，方法不能被重写
    //修饰字段（变量），变量变成常量，只可以被赋值一次
    //命名规则：所有大写英文，多个英文使用下划线分割
    public static final String EXCEL_PATH="src/main/resources/cases_v8.xlsx";
    public static final int ACTUAL_RESPONSE_DATA_CELLNUM=5;
    public static final int ASSERT_CELLNUM = 6;

    //数据库连接url

    public static final String JDBC_URL = "jdbc:mysql://api.lemonban.com:3306/futureloan?useUnicode=true&characterEncoding=utf-8";
    //数据库连接用户名
    public static final String JDBC_USER="future";
    //数据库连接密码
    public static final String JDBC_PASSWORD="123456";


    //参数化替换字段中
    public static final String REGISTER_MOBILE_TEXT ="${toBeRegisterMobilephone}";
    public static final String REGISTER_PASSWORD_TEXT="${toBeRegisterPassword}";
    public static final String LOGIN_MOBILE_TEXT="${toBeLoginMobilephone}";
    public static final String LOGIN_PASSWORD_TEXT="${toBeLoginPassword}";
    public static final String MEMBER_ID="${member_id}";

    //参数化替换值
    public static final String REGISTER_MOBILE_VALUE =getTel();
    public static final String REGISTER_PASSWORD_VALUE="12345678";
    public static final String LOGIN_MOBILE_VALUE=REGISTER_MOBILE_VALUE;
    public static final String LOGIN_PASSWORD_VALUE="12345678";

    public static int getNum(int start,int end) {
        return (int)(Math.random()*(end-start+1)+start);
    }


    //private static String[] telFirst="134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153".split(",");
    private static String getTel() {
        String[] telFirst="134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153".split(",");
        int index=getNum(0,telFirst.length-1);
        String first=telFirst[index];
        String second=String.valueOf(getNum(1,888)+10000).substring(1);
        String third=String.valueOf(getNum(1,9100)+10000).substring(1);
        return first+second+third;
    }


    public static void main(String[] args) {
        System.out.println(getTel());
    }













}
